#!/usr/bin/python3
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-

import os
from common_python import check_package_installed

pkgInfo = {
    "gentoo": [
        "app-admin/eselect",
    ],
}
bMainPkg = False
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    bMainPkg = True

    if os.path.exists("/usr/share/eselect/modules/locale.eselect"):
        print("/etc/locale.conf")
        print("/etc/env.d/02locale")              # symlink to /etc/locale.conf

    if os.path.exists("/usr/share/eselect/modules/editor.eselect"):
        print("/etc/env.d/99editor")

    if os.path.exists("/usr/share/eselect/modules/news.eselect"):
        print("/var/lib/gentoo/news/***")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-cdparanoia",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    # it seems app-admin/eselect-cdparanoia does not depend on app-admin/eselect, bug?
    assert bMainPkg

    print("/usr/bin/cdparanoia")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-java",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    print("/etc/java-config-2/current-system-vm")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-iptables",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    print("/usr/sbin/iptables")
    print("/usr/sbin/iptables-save")
    print("/usr/sbin/iptables-restore")

    print("/usr/sbin/ip6tables")
    print("/usr/sbin/ip6tables-save")
    print("/usr/sbin/ip6tables-restore")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-mpg123",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    # it seems app-admin/eselect-mpg123 does not depend on app-admin/eselect, bug?
    assert bMainPkg

    print("/usr/bin/mpg123")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-notify-send",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    print("/usr/bin/notify-send")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-pinentry",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    # it seems app-admin/eselect-pinentry does not depend on app-admin/eselect, bug?
    assert bMainPkg

    print("/usr/bin/pinentry")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-postgresql",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    # it seems app-admin/eselect-postgresql does not depend on app-admin/eselect, bug?
    assert bMainPkg

    print("/usr/share/postgresql")

    print("/usr/share/pkgconfig/libecpg.pc")
    print("/usr/share/pkgconfig/libecpg_compat.pc")
    print("/usr/share/pkgconfig/libpgtypes.pc")
    print("/usr/share/pkgconfig/libpq.pc")

    print("/usr/include/libpq")
    print("/usr/include/libpq-fe.h")
    print("/usr/include/postgresql")
    print("/usr/include/postgres_ext.h")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-rust",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    print("/etc/env.d/rust/last-set")

    print("/usr/bin/cargo")
    print("/usr/bin/cargo-fmt")
    print("/usr/bin/rustc")
    print("/usr/bin/rustdoc")
    print("/usr/bin/rustfmt")
    print("/usr/bin/rust-gdb")
    print("/usr/bin/rust-gdbgui")
    print("/usr/bin/rust-lldb")

    print("/usr/lib/rustlib")
    print("/usr/lib/rust/lib")
    print("/usr/lib/rust/man")

    print("/usr/share/doc/rust")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-timezone",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    print("/etc/localtime")
    print("/etc/timezone")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-wine",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    print("/etc/eselect/wine/***")


pkgInfo = {
    "gentoo": [
        "app-eselect/eselect-wxwidgets",
    ],
}
if check_package_installed(pkgInfo, exit_or_return=False) is not None:
    print("/var/lib/wxwidgets/current")


# eselect-ctags
# echo /usr/bin/ctags
# cruftfile "/usr/share/man/man1/ctags\.1\..*"


# eselect-ruby
# echo /usr/bin/ruby
# echo /usr/bin/irb
# echo /usr/bin/erb
# echo /usr/bin/gem
# echo /usr/bin/rdoc
# echo /usr/bin/ri
# echo /usr/bin/testrb
# cruftfile  "/usr/share/man/man1/ruby\.1\..*"


# eselect-vi
# echo /usr/bin/ex
# echo /usr/bin/vi
# echo /usr/bin/view
# cruftfile "/usr/share/man/man1/ex\.1\..*"
# cruftfile "/usr/share/man/man1/vi\.1\..*"
# cruftfile "/usr/share/man/man1/view\.1\..*"


# eselect-blas
# echo "/usr/lib64/libblas.a"
# echo "/usr/lib64/libblas.so"
# echo "/usr/lib64/libblas.so.3"
# echo "/usr/lib64/pkgconfig/blas.pc"


# eselect-cblas
# echo "/usr/include/cblas.h"
# echo "/usr/include/cblas_f77.h"
# echo "/usr/include/cblas_mangling.h"
# echo "/usr/include/cblas_test.h"
# echo "/usr/lib64/libcblas.a"
# echo "/usr/lib64/libcblas.so"
# echo "/usr/lib64/libcblas.so.3"
# echo "/usr/lib64/pkgconfig/cblas.pc"


# eselect-lapack
# echo "/usr/lib64/liblapack.a"
# echo "/usr/lib64/liblapack.so"
# echo "/usr/lib64/liblapack.so.3"
# echo "/usr/lib64/pkgconfig/lapack.pc"


# eselect-vi
# echo "/usr/bin/ex"
# echo "/usr/bin/vi"
# echo "/usr/bin/view"
